package com.qingzhuge.common.enums;


import com.qingzhuge.common.IBaseEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author : zero.xiao
 * @description :会员登录方式
 * @date : 2018/6/26 0026 下午 12:27
 * @modified :
 * @since :
 */
public enum EMemberLoginType implements IBaseEnum<String> {
    /***/
    usernameAndPwd("用户名和密码"),
    usernameAndPwdAndSms("用户名和密码与短信验证码"),
    mobileAndSms("手机号和短信验证码");

    private String value;

    EMemberLoginType(String value) {
        this.value = value;
    }

    @Override
    public String value() {
        return value;
    }

    public static EMemberLoginType get(String name) {
        if (name == null) {
            return null;
        }
        EMemberLoginType[] vals = EMemberLoginType.values();
        for (EMemberLoginType e : vals) {
            boolean b = e.name().equals(name);
            if (b) {
                return EMemberLoginType.valueOf(name);
            }
        }
        return null;
    }

    public static Map<String,Object> map(){
        Map<String,Object> emap = new HashMap<>();
        EMemberLoginType[] vals = EMemberLoginType.values();
        for (EMemberLoginType e : vals) {
            emap.put(e.name(),e.value);
        }
        return emap;
    }
}
